package com.attendance.entity.dto;

import java.util.Date;

import com.attendance.entity.ApplyLeave;
import com.common.util.Examine;
import com.fasterxml.jackson.annotation.JsonFormat;

public class ApplyLeaveDTO {
	private Long id;
	private String staffName;
	private String staffNum;
	private String reason;
	private Date startTime;
	private Date endTime;
	private String status;
	private String auditor;
	private Date launchTime;
	private Date examineTime;
	private String examineReason;//审核意见
	
	public ApplyLeaveDTO(String staffName,String staffNum,ApplyLeave applyLeave,String auditor) {
		super();
		this.staffName = staffName;
		this.staffNum = staffNum;
		this.auditor = auditor;
		if(applyLeave!=null) {
			this.id = applyLeave.getId();
			this.reason = applyLeave.getReason();
			this.startTime = applyLeave.getStartTime();
			this.launchTime = applyLeave.getLaunchTime();
			this.endTime = applyLeave.getEndTime();
			this.examineReason = applyLeave.getExamineReason();
			this.examineTime = applyLeave.getExamineTime();
			if(applyLeave.getStatus() == Examine.Pass) {this.status = "已通过";}
			else if(applyLeave.getStatus() == Examine.NotPass) {this.status = "已驳回";}
			else if(applyLeave.getStatus() == Examine.Unaudited) {this.status = "待审核";}
			else if(applyLeave.getStatus() == Examine.Retracted) {this.status = "已撤回";}
			else {this.status = null;}
		}
	}
	public ApplyLeaveDTO() {
		super();
	}
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getStaffName() {
		return staffName;
	}
	public void setStaffName(String staffName) {
		this.staffName = staffName;
	}
	public String getStaffNum() {
		return staffNum;
	}
	public void setStaffNum(String staffNum) {
		this.staffNum = staffNum;
	}
	public String getReason() {
		return reason;
	}
	public void setReason(String reason) {
		this.reason = reason;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getAuditor() {
		return auditor;
	}
	public void setAuditor(String auditor) {
		this.auditor = auditor;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getLaunchTime() {
		return launchTime;
	}
	public void setLaunchTime(Date launchTime) {
		this.launchTime = launchTime;
	}
	@JsonFormat(pattern = "yyyy/MM/dd HH:mm:ss",timezone = "GMT+8")
	public Date getExamineTime() {
		return examineTime;
	}
	public void setExamineTime(Date examineTime) {
		this.examineTime = examineTime;
	}
	public String getExamineReason() {
		return examineReason;
	}
	public void setExamineReason(String examineReason) {
		this.examineReason = examineReason;
	}
	
}
